#ifndef __PHAARFEATURE_H
#define __PHAARFEATURE_H

#include "sdopencv/polyint.hpp"

namespace sdopencv
{
    struct PHaarFeature
    {
        CvPolygon p[2]; // polygon -- be careful with the direction of points, can change sign
        double A[2]; // area / coefficient

        // swap x and y altogether
        PHaarFeature swap();

        // rotate the feature by 90 degrees x -> y -> M-x -> M-y
        PHaarFeature rotate90(int M);

        // rotate the feature by 180 degrees x -> M-x, y -> M-y
        PHaarFeature rotate180(int M);
    };

}

std::istream& operator >>(std::istream &is, sdopencv::PHaarFeature &obj);
std::ostream& operator <<(std::ostream &os, const sdopencv::PHaarFeature &obj);

#endif
